home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 1 / CU Amiga Magazine CD-ROM Special Edition (1995)(EMAP Images)(GB)[Issue 1995-11].iso / Aminet / comm / tcp / AmiTCPsdk_40.lha / AmiTCP-4.0 / netinclude / sys / param.h < prev    next >
C/C++ Source or Header  |  1994-10-05  |  2KB  |  96 lines

  1. #ifndef SYS_PARAM_H
  2. #define SYS_PARAM_H \
  3.        "$Id: param.h,v 4.1 1994/10/05 23:12:24 ppessi Exp $"
  4. /*
  5.  *    Definitions of some system parameters, FD_SET macros
  6.  *
  7.  *      Copyright © 1994 AmiTCP/IP Group,
  8.  *                       Network Solutions Development, Inc.
  9.  *                       All rights reserved.
  10.  */
  11.  
  12. /*
  13.  * AmiTCP/IP is not BSD4.3 compatible
  14.  */
  15. #define    BSD    199402    /* Feb, 1994 system version (year & month) */
  16. #define BSD4_3    1
  17. #define BSD4_4    1
  18.  
  19. #ifndef SYS_TYPES_H
  20. #include <sys/types.h>
  21. #endif
  22.  
  23. #define NOFILE        FD_SETSIZE /* perhaps we shouldn't use FD_SETSIZE */
  24.  
  25. #define    BIG_ENDIAN    4321    /* MSB first: 68000, ibm, net */
  26. #define    BYTE_ORDER    BIG_ENDIAN
  27.  
  28. #define MAXHOSTNAMELEN  64    /* max length of hostname */
  29. #define MAXLOGNAME      32    /* max length of login name */
  30.  
  31. /*
  32.  * Macros for network/external number representation conversion.
  33.  */
  34. #ifndef ntohl
  35. #define    ntohl(x)    (x)
  36. #define    ntohs(x)    (x)
  37. #define    htonl(x)    (x)
  38. #define    htons(x)    (x)
  39.  
  40. #define    NTOHL(x)    (x)
  41. #define    NTOHS(x)    (x)
  42. #define    HTONL(x)    (x)
  43. #define    HTONS(x)    (x)
  44. #endif
  45.  
  46. /* Limits */
  47. #if __SASC
  48. #ifndef _LIMITS_H
  49. #include <limits.h>
  50. #endif
  51. #elif __GNUC__
  52. #ifndef _MACHINE_LIMITS_H
  53. #include <machine/limits.h>
  54. #endif
  55. #undef LONGBITS            /* exec/types wants to use this symbol */
  56. #undef BITSPERBYTE        /* dos/dos.h defines this */
  57. #undef MAXINT            /* dos/dos.h defines this */
  58. #undef MININT            /* dos/dos.h defines this */
  59. #endif
  60.  
  61. /* Bit map related macros. */
  62. #define    setbit(a,i)    ((a)[(i)/NBBY] |= 1<<((i)%NBBY))
  63. #define    clrbit(a,i)    ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY)))
  64. #define    isset(a,i)    ((a)[(i)/NBBY] & (1<<((i)%NBBY)))
  65. #define    isclr(a,i)    (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0)
  66.  
  67. /* Macros for counting and rounding. */
  68. #ifndef howmany
  69. #define    howmany(x, y)    (((x)+((y)-1))/(y))
  70. #endif
  71. #define    roundup(x, y)    ((((x)+((y)-1))/(y))*(y))
  72. #define powerof2(x)    ((((x)-1)&(x))==0)
  73.  
  74. #ifndef KERNEL            /* Kernel has these in kern/amiga_subr.h */
  75. #if __SASC            /* SASC has built-in versions */
  76. #ifndef _STRING_H
  77. #ifndef USE_BUILTIN_MATH
  78. #define USE_BUILTIN_MATH
  79. #endif
  80. #include <string.h>
  81. #endif
  82.  
  83. #else
  84.  
  85. #ifndef min
  86. #define min(x,y) ((x) < (y) ? (x) : (y))
  87. #endif
  88. #ifndef max
  89. #define max(x,y) ((x) > (y) ? (x) : (y))
  90. #endif
  91.  
  92. #endif
  93. #endif /* !KERNEL */
  94.  
  95. #endif /* !SYS_PARAM_H */
  96.